import request from '@/utils/request'

export function getBnnerList(params) {
  return request({
    url: '/banners',
    method: 'get',
    params
  })
}

export function addBanner(params) {
  var formData = params
  return request({
    url: '/banners',
    method: 'post',
    'Content-Type': 'multipart/form-data',
    data: formData
  })
}

export function delBanner(id) {
  return request({
    url: `/banners/${id}`,
    method: 'delete'
  })
}

export function editBanner(id, params) {
  var formData = params
  return request({
    url: `/banners/${id}`,
    method: 'put',
    'Content-Type': 'multipart/form-data',
    data: formData
  })
}

export function isuseBanner(params) {
  return request({
    url: '/banners/isuse',
    method: 'post',
    data: params
  })
}
